﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Apache.Cassandra;
using Lucandra.Convenience;

namespace Lucandra.Net.Convenience
{
    internal sealed class StandardColumnMutation
    {
        Mutation mutation;

        public byte[] Name { get; private set; }
        public byte[] Value { get; private set; }
        public long Timestamp { get; private set; }

        public StandardColumnMutation(string columnName, byte[] value)
        {
            this.mutation = new Mutation()
            {
                Column_or_supercolumn = new ColumnOrSuperColumn()
                {
                    Column = CassandraHelper.CreateCassandraColumn(columnName, value)
                }
            };
        }

        public static implicit operator Mutation(StandardColumnMutation mut)
        {
            return mut.mutation;
        }
    }
}
